<template>
  <div>
    <h1>Topic -- index</h1>
    <ul>
      <li v-for="item in list" :key="item.id">
        {{ item }}
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  async asyncData({ error }) {
    try {
      let { data } = await $axios.get("http://localhost:2345/classify/list");
      return { list: data.data };
    } catch (e) {
      error({ msg: "错误页面" });
    }
  },
  // async asyncData({ $axios }) {
  //   let { data } = await $axios.get("http://localhost:2345/classify/list");
  //   return { list: data.data };
  // },
};
</script>

<style scoped>
</style>